Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "using" field not working in array form for construction recipes #34533

Merged

Conversation

lazho
Copy link
Contributor

@lazho lazho commented Oct 7, 2019

Summary

SUMMARY: Bugfixes "Fix construction recipes with missing requirements"

Purpose of change

Fixes #34191 - "using" field doesn't work in array form for construction recipes

Describe the solution

Added a std::vector<std::pair<requirement_id, int>> to construction to store the requirements specified with "using". Since construction.json loads before these "using" requirements, the added vector is only added into construction.requirements during finalize_constructions

Describe alternatives you've considered

I didn't like the fact that I kind of copypasta'd this logic - the next time requirement syntax changes, one of the two will be easily missed and silently fail just like this issue. Maybe consider a more generic solution instead, since they both do the same thing.

Additional Context

Before:
before
After:
after

@lazho lazho changed the title fix "using" field not working in array form for construction recipes [WIP] fix "using" field not working in array form for construction recipes Oct 7, 2019
@lazho lazho force-pushed the 34191-fix-construction-using-array branch from 9866e95 to 8e04826 Compare October 7, 2019 05:44
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Oct 7, 2019
@lazho lazho force-pushed the 34191-fix-construction-using-array branch 2 times, most recently from 4a01d1f to 270061e Compare October 7, 2019 07:29
@lazho lazho changed the title [WIP] fix "using" field not working in array form for construction recipes fix "using" field not working in array form for construction recipes Oct 7, 2019
@snipercup
Copy link
Contributor

I tested it. I can compile just fine and i'm getting the same results in game.

@lazho lazho force-pushed the 34191-fix-construction-using-array branch from e13c737 to 8968513 Compare October 8, 2019 04:24
@Rivet-the-Zombie Rivet-the-Zombie merged commit 254c7c2 into CleverRaven:master Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"using" field doesn't work as intended for construction recipe
4 participants